import { _decorator, SpriteFrame, AnimationClip } from "cc";

export class AnimState3 {
  private _spriteFrameArray: SpriteFrame[] = [];
  private _frameRate: number = 12;
  private _clipDuration: number = 1;
  private _clipWrapMode: number = AnimationClip.WrapMode.Loop;
  private _clipName: string = "DefaultClipName3";

  constructor(
    frameRate?: number,
    clipDuration?: number,
    clipWrapMode?: number,
    clipName?: string,
    spriteFrameArray?: SpriteFrame[]
  ) {
    if (frameRate !== undefined) this._frameRate = frameRate;
    if (clipDuration !== undefined) this._clipDuration = clipDuration;
    if (clipWrapMode !== undefined) this._clipWrapMode = clipWrapMode;
    if (clipName !== undefined) this._clipName = clipName;
    if (spriteFrameArray !== undefined)
      this._spriteFrameArray = spriteFrameArray;
  }

  // Getter and Setter for spriteFrameArray
  get spriteFrameArray(): SpriteFrame[] {
    return this._spriteFrameArray;
  }

  set spriteFrameArray(value: SpriteFrame[]) {
    this._spriteFrameArray = value;
  }

  // Getter and Setter for frameRate
  get frameRate(): number {
    return this._frameRate;
  }

  set frameRate(value: number) {
    this._frameRate = value;
  }

  // Getter and Setter for clipDuration
  get clipDuration(): number {
    return this._clipDuration;
  }

  set clipDuration(value: number) {
    this._clipDuration = value;
  }

  // Getter and Setter for clipWrapMode
  get clipWrapMode(): number {
    return this._clipWrapMode;
  }

  set clipWrapMode(value: number) {
    this._clipWrapMode = value;
  }

  // Getter and Setter for clipName
  get clipName(): string {
    return this._clipName;
  }

  set clipName(value: string) {
    this._clipName = value;
  }
}
